'''
定义  一对[] 中括号的数据
'''

# data_01 = []
# data_02 = ["a","b","c"]
# data_03 =[ ["docker","25.4"],["k8s","1.29"] ]
# print(type(data_01),type(data_02),type(data_03))
#
for i in range(11):
    if(i < 10):
        print(i,end=" ")
    else:
        print(i)

# 列表解析， 快速生成列表的方法
data_04 =[ i for i in range(1,11) ]
print(data_04)

data_05 =[ "10.1.1.%s"%i for i in range(1,11)]
print(data_05)

data_06 =[i**2 for i in range(1,11)if i%2 != 0 ]
print(data_06)

#----------------列表的常规操作--------------------
# len()data_07 =[ "redis","MySQL","mongodb" ]
# print(len(data_07))

# in , not in
# print("redis" in data_07)
# data_08 = [ ["docker", "25.4"], ["k8s", "1.29"] ]
# print(len(data_08))
# print("docker" in data_08)
# print(["docker", "25.4"] in data_08)
# print("---------------------" * 3)


# data_08= []
# data_08.append("武鹏大傻逼")
# data_08.append("武鹏大傻逼")
# data_08.append("武鹏大傻逼")
# data_08.append("武鹏大傻逼")
# data_08.append("武鹏大傻逼")
# print(data_08)


# for i in range(0,100,5):
#     print("5的倍数: %s" % i)
#
# # 索引操作
# data_07 = [ "redis", "MySQL", "mongodb" ]
# print(data_07[0])
# print(data_07[-1])
#
# data_08 = [ ["docker", "25.4"], ["k8s", "1.29"] ]
# print(data_08[-1])
# print(data_08[-1][-1])
#
# print("---------------------" * 3)


# 列表，可变数据类型
# data_08[-1][-1] = "1.26"
# print(data_08)
#
# print("---------------------" * 3)


# append()   追加数据
# data_09 = []
#
# data_09.append("linux")
# data_09.append("unix")
# data_09.append("macos")
# data_09.append("kylin")
#
# print(data_09)
#
# print("---------------------" * 3)

# ----------------------------------------------列表的遍历------------------------------------------

# data_10 = [ "php", "php-mysql", "php-common", "php-fpm" ]
#
# for i in data_10:
#     print("yum install -y %s" % i)
#
# print("---------------------" * 3)
#
# # ssh 用户名@IP
# data_11 = [ ["10.1.1.1", "admin"], ["172.16.10.1", "martin"], ["192.168.1.1", "root"] ]
#
# for ip, user in data_11:
#     print("ssh %s@%s" % (user, ip))